﻿<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>顽石旅游线路后台管理系统 - 登录</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/login.css">
    <script src="${pageContext.request.contextPath}/bootstrap/js/jquery-2.1.0.min.js"></script>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background-color: #2d3a4b;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            margin: 0;
        }

        .login-container {
            background-color: rgba(255, 255, 255, 0.1);
            padding: 40px;
            border-radius: 10px;
            box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
            width: 400px;
            text-align: center;
        }

        .login-container h3 {
            font-size: 26px;
            color: #eee;
            margin-bottom: 40px;
            font-weight: bold;
        }

        .login-container label {
            color: #fff;
            display: block;
            margin-bottom: 5px;
            text-align: left;
        }

        .login-container .form-control {
            background: transparent;
            border: 1px solid rgba(255, 255, 255, 0.1);
            height: 50px;
            color: #fff;
            border-radius: 5px;
            margin-bottom: 20px;
            transition: border-color 0.3s ease;
        }

        .login-container .form-control:focus {
            border-color: #3a8ee6;
            outline: none;
        }

        .login-container input[type=button] {
            width: 100%;
            background: #3a8ee6;
            border-color: #3a8ee6;
            color: #FFF;
            font-weight: 500;
            padding: 10px;
            font-size: 14px;
            border-radius: 4px;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }

        .login-container input[type=button]:hover {
            background-color: #2979c2;
        }

        /* 验证码部分样式 */
        .captcha-group {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .captcha-group .captcha-input {
            flex: 1;
            margin-right: 20px;
        }

        .captcha-group .captcha {
            width: 30%;
            height: 50px;
            object-fit: cover;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <h3>顽石旅游线路后台管理系统</h3>
        <form action="${pageContext.request.contextPath}/houuser/houlogin" method="POST" id="loginForm">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" name="username" class="form-control" id="username" placeholder="请输入用户名" autocomplete="off">
            </div>
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" name="password" class="form-control" id="password" placeholder="请输入密码">
            </div>
            <input type="submit" value="登录" class="btn">
            <div class="error-message" id="errorMessage"></div>
        </form>
    </div>

    <style>
        /* 错误提示样式 */
        .error-message {
            color: #ff4d4f;
            background-color: #fff1f0;
            padding: 10px;
            border-radius: 4px;
            border: 1px solid #ffa39e;
            margin-top: 10px;
            font-size: 14px;
            display: none;
        }

        .error-message.show {
            display: block;
        }
    </style>

    <script>
        function validateForm() {
            var username = $('#username').val();
            var password = $('#password').val();

            if (username.trim() === '') {
                $('#errorMessage').text('用户名不能为空').addClass('show');
                return false;
            }

            if (password.trim() === '') {
                $('#errorMessage').text('密码不能为空').addClass('show');
                return false;
            }

            $('#errorMessage').removeClass('show');
            return true;
        }

        $(function() {
            $('#loginForm').submit(function() {
                return validateForm();
            });
        });
    </script>
</body>
</html>